<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Home</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Home</h1>

    



    


    <h3>chordplayer 1.1.6</h3>










    




    <section>
        <article><h1>CHORDPLAYER.JS</h1><h2>Installation:</h2><p>You may import the code into an existing node.js project or import it directly into your HTML code</p>
<ul>
<li>Node module import<pre class="prettyprint source lang-shell"><code># local install to your project
npm install --save-dev chordplayer</code></pre><pre class="prettyprint source lang-javascript"><code>// import module into your js code
var cp = require('chordplayer')</code></pre></li>
<li>plain JS import<pre class="prettyprint source lang-html"><code>&lt;!-- minified version, not human friendly, 56kb-->
&lt;script type=&quot;text/javascript&quot; src=&quot;chordPlayer.min.js&quot;>&lt;/script>
&lt;!-- uncompressed version, human friendly, 418kb -->
&lt;script type=&quot;text/javascript&quot; src=&quot;chordPlayer.js&quot;>&lt;/script></code></pre>The module is instanciated in the object cp, which you can use right away<pre class="prettyprint source lang-javascript"><code>cp.buildChordPlayer(&quot;Cmin7b5&quot;).play()</code></pre></li>
</ul>
<h2>Constructors</h2><p>There are several ways to instanciate the class:</p>
<ul>
<li><p><code>buildChordPlayer(chordName,[audioContext])</code></p>
<p>Builds a chordPlayer from a specific name. 
audioContext is created if not provided.</p>
<pre class="prettyprint source lang-javascript"><code>c = cp.buildChordPlayer(&quot;Cmin7b5&quot;);     //will return a chord with 4 notes (&quot;C&quot;, &quot;D#&quot;, &quot;F#&quot;, &quot;A#&quot;)
c = cp.buildChordPlayer(&quot;Cdim&quot;);        //will return a chord with 3 notes (&quot;C&quot;, &quot;D#&quot;, &quot;F#&quot;)
c = cp.buildChordPlayer(&quot;A#maj&quot;);       //will return a chord with 3 notes (&quot;A#&quot;, &quot;D&quot;, &quot;F&quot;)
c = cp.buildChordPlayer(&quot;Bbmaj&quot;);       //will return a chord with 3 notes (&quot;A#&quot;, &quot;D&quot;, &quot;F&quot;)</code></pre></li>
</ul>
<h2>Methods</h2><ul>
<li><p><code>play([callback])</code></p>
<p>Plays the chord</p>
<pre class="prettyprint source lang-javascript"><code>c = cp.buildChordPlayer(&quot;Amaj&quot;)
c.play(function(){
 console.log(&quot;end play&quot;)
})</code></pre></li>
<li><p><code>getChordInfo()</code></p>
<p>Returns the notes present in the chord</p>
<pre class="prettyprint source lang-javascript"><code>cp.buildChordPlayer(&quot;Bbmaj&quot;).getChordInfo()</code></pre></li>
</ul>
<p>Setters: </p>
<ul>
<li><code>setAudioContext(audioContext)</code></li>
<li><code>setDestinationNode(node)</code></li>
<li><code>setDuration(duration)</code></li>
<li><code>setOctave(octaveNb)</code></li>
<li><code>setVolume(volume)</code></li>
</ul></article>
    </section>






</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="chordPlayer.html">chordPlayer</a></li></ul><h3>Global</h3><ul><li><a href="global.html#buildChordPlayer">buildChordPlayer</a></li><li><a href="global.html#getChordInfo">getChordInfo</a></li><li><a href="global.html#play">play</a></li><li><a href="global.html#setAudioContext">setAudioContext</a></li><li><a href="global.html#setDestinationNode">setDestinationNode</a></li><li><a href="global.html#setDuration">setDuration</a></li><li><a href="global.html#setOctave">setOctave</a></li><li><a href="global.html#setVerbose">setVerbose</a></li><li><a href="global.html#setVolume">setVolume</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Dec 08 2016 20:20:04 GMT+0000 (GMT)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>